package org.apache.jsp.manager.goods;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import common.conf.*;
import java.util.*;
import manager.goods.*;

public final class GoodsList_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=euc-kr");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      java.util.Hashtable outputTable = null;
      synchronized (request) {
        outputTable = (java.util.Hashtable) _jspx_page_context.getAttribute("outputTable", PageContext.REQUEST_SCOPE);
        if (outputTable == null){
          outputTable = new java.util.Hashtable();
          _jspx_page_context.setAttribute("outputTable", outputTable, PageContext.REQUEST_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      java.util.Hashtable inputTable = null;
      synchronized (request) {
        inputTable = (java.util.Hashtable) _jspx_page_context.getAttribute("inputTable", PageContext.REQUEST_SCOPE);
        if (inputTable == null){
          inputTable = new java.util.Hashtable();
          _jspx_page_context.setAttribute("inputTable", inputTable, PageContext.REQUEST_SCOPE);
        }
      }
      out.write("\r\n");
      out.write("\r\n");

		GoodsListBean glb = new GoodsListBean();
		glb.funcExecute();
		ArrayList GoodsList2 = glb.getDataList();
		outputTable.put("GoodsList", GoodsList2);

		ArrayList GoodsList = (ArrayList)outputTable.get("GoodsList");


      out.write("\r\n");
      out.write("\r\n");
      out.write("<SCRIPT language=\"JavaScript\">\r\n");
      out.write("\t// 상세정보 페이지 가기\r\n");
      out.write("\tfunction goDetailInfo(code)\r\n");
      out.write("\t{\r\n");
      out.write("\t\tdocument.location.href=\"/servlet/service.ManagerBbsServlet?func=managerBbs_002&code=\"+code;\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\t// 게시판 수정 페이지 가기\r\n");
      out.write("\tfunction goUpdate(code)\r\n");
      out.write("\t{\r\n");
      out.write("\t\tdocument.location.href='/servlet/service.ManagerBbsServlet?func=managerBbs_005&from=list&code='+code;\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\t// 게시판 사용 or 삭제 하기\r\n");
      out.write("\tfunction useYnAction(seq, yn)\r\n");
      out.write("\t{\r\n");
      out.write("\t\tvar alertStr = \"선택하신 물품을 사용하지 못하게 하시겠습니까?\";\r\n");
      out.write("\t\tif(yn=='Y')\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\t\talertStr = \"선택하신 물품을 사용 하시겠습니까?\";\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\tif(confirm(alertStr))\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\t\tdocument.location.href=\"/servlet/service.ManagerGoodsServlet?func=managerGoods_004&yn=\"+yn+\"&seq=\"+seq;\r\n");
      out.write("\t\t}\r\n");
      out.write("\t}\r\n");
      out.write("\r\n");
      out.write("\t// 게시판 추가\r\n");
      out.write("\tfunction goAdd()\r\n");
      out.write("\t{\r\n");
      out.write("\t\tdocument.location.href=\"/servlet/service.ManagerGoodsServlet?func=managerGoods_002\";\r\n");
      out.write("\t}\r\n");
      out.write("</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("<CENTER>\r\n");
      out.write("\t<TABLE cellspacing=\"0\" cellpadding=\"0\">\r\n");
      out.write("\t\t<TR><TD height=\"25\"></TD></TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"1\" cellpadding=\"5\" bgcolor=\"#7682EB\" width=\"250\">\r\n");
      out.write("\t\t<TR>\r\n");
      out.write("\t\t\t<TD align=\"center\" bgcolor=\"#CFDDFA\" width=\"250\">\r\n");
      out.write("\t\t\t\t<FONT color=\"blue\" size=\"3\"><B>상품 목록</B></FONT>\r\n");
      out.write("\t\t\t</TD>\r\n");
      out.write("\t\t</TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"0\" cellpadding=\"0\" width=\"750\">\r\n");
      out.write("\t\t<TR>\r\n");
      out.write("\t\t\t<TD align=\"right\">\r\n");
      out.write("\t\t\t\t<IMG src=\"/images/button/button_add.gif\" border=\"0\" onclick=\"goAdd();\" style=\"cursor:hand\" align=\"absmiddle\">\r\n");
      out.write("\t\t\t</TD>\r\n");
      out.write("\t\t</TR>\r\n");
      out.write("\t\t<TR><TD height=\"3\"></TD></TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"1\" cellpadding=\"3\" bgcolor=\"#7682EB\" width=\"750\">\r\n");
      out.write("\t\t<TR bgcolor=\"#CFDDFA\" align=\"center\">\r\n");
      out.write("\t\t\t<TD width=\"50\"><B>번호</B></TD>\r\n");
      out.write("\t\t\t<TD width=\"120\"><B>제품명</B></TD>\r\n");
      out.write("\t\t\t<TD width=\"80\"><B>판매가</B></TD>\r\n");
      out.write("\t\t\t<TD width=\"150\"><B>물품정보</B></TD>\r\n");
      out.write("\t\t\t<TD width=\"50\"><B>장르</B></TD>\r\n");
      out.write("\t\t\t<TD width=\"50\"><B>타입</B></TD>\r\n");
      out.write("\t\t\t<TD width=\"50\"><B>제조사</B></TD>\r\n");
      out.write("\t\t\t<TD width=\"50\"><B>수량</B></TD>\r\n");
      out.write("\t\t\t<TD width=\"80\"><B>삭제/사용</B></TD>\r\n");
      out.write("\t\t</TR>\r\n");

	for(int i=0; i<GoodsList.size(); i++)
	{

		Hashtable bbsInfoTable = (Hashtable)GoodsList.get(i);
		String seq = (String)bbsInfoTable.get("SEQ");
		String name = (String)bbsInfoTable.get("NAME");
		String wonga = (String)bbsInfoTable.get("WONGA");
		String price = (String)bbsInfoTable.get("PRICE");
		String info = (String)bbsInfoTable.get("INFO");
		String genre_code = (String)bbsInfoTable.get("GENRE_CODE");
		String type_code = (String)bbsInfoTable.get("TYPE_CODE");
		String company_code = (String)bbsInfoTable.get("COMPANY_CODE");
		String amount = (String)bbsInfoTable.get("AMOUNT");
		String useyn = (String)bbsInfoTable.get("USEYN");
		
		String bonus = (String)bbsInfoTable.get("BONUS");
		String reg_id = (String)bbsInfoTable.get("REG_ID");
		String upd_id = (String)bbsInfoTable.get("UPD_ID");
		String reg_date = (String)bbsInfoTable.get("REG_DATE");
		String upd_date = (String)bbsInfoTable.get("UPD_DATE");
		

		

		String bgcolor = "#FFFFFF";
		if(useyn.equals("N"))
		{
			bgcolor = "#E0E0E0";
		}

		String useKor = "사용중";
		if(useyn.equals("N"))
		{
			useKor = "미사용";
		}

      out.write("\r\n");
      out.write("\t\t<TR bgcolor=\"");
      out.print(bgcolor );
      out.write("\">\r\n");
      out.write("\t\t\t<TD align=\"center\"><A href=\"javascript:goDetailInfo('");
      out.print(seq );
      out.write("')\"><B>");
      out.print(seq );
      out.write("</B></A></TD>\r\n");
      out.write("\t\t\t<TD><A href=\"javascript:goDetailInfo('");
      out.print(seq );
      out.write("')\">");
      out.print( name);
      out.write("</A></TD>\r\n");
      out.write("\t\t\t<TD align=\"center\">");
      out.print(price );
      out.write("</TD>\r\n");
      out.write("\t\t\t<TD align=\"center\">");
      out.print(info );
      out.write("</TD>\r\n");
      out.write("\t\t\t<TD align=\"center\">");
      out.print(genre_code );
      out.write("</TD>\r\n");
      out.write("\t\t\t<TD align=\"center\">");
      out.print(type_code );
      out.write("</TD>\r\n");
      out.write("\t\t\t<TD align=\"center\">");
      out.print(company_code );
      out.write("</TD>\r\n");
      out.write("\t\t\t<TD align=\"center\">");
      out.print(amount );
      out.write("</TD>\r\n");
      out.write("\t\t\t<TD align=\"center\">\r\n");
      out.write("\t\t\t\t<IMG src=\"/images/button/sbut_update.gif\" align=\"absmiddle\" border=\"0\" style=\"cursor:hand\" onClick=\"goUpdate('");
      out.print(seq );
      out.write("')\">\r\n");

		if(useyn.equals("Y"))
		{

      out.write("\r\n");
      out.write("\t\t\t\t<IMG src=\"/images/button/sbut_delete.gif\" align=\"absmiddle\" border=\"0\" style=\"cursor:hand\" onClick=\"useYnAction('");
      out.print(seq );
      out.write("', 'N');\">\r\n");

		}
		else
		{

      out.write("\r\n");
      out.write("\t\t\t\t<IMG src=\"/images/button/sbut_use.gif\" align=\"absmiddle\" border=\"0\" style=\"cursor:hand\" onClick=\"useYnAction('");
      out.print(seq );
      out.write("', 'Y');\">\r\n");

		}

      out.write("\r\n");
      out.write("\t\t\t</TD>\r\n");
      out.write("\t\t</TR>\r\n");

	}

	if(GoodsList.size()==0)
	{

      out.write("\r\n");
      out.write("\t\t<TR><TD align=\"center\" bgcolor=\"#FFFFFF\" colspan=\"9\"><B>등록된 물품 정보가 없습니다.</B></TD></TR>\r\n");

	}

      out.write("\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("\t<TABLE cellspacing=\"0\" cellpadding=\"0\" width=\"700\">\r\n");
      out.write("\t\t<TR><TD height=\"20\"></TD></TR>\r\n");
      out.write("\t</TABLE>\r\n");
      out.write("</CENTER>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
